import * as echarts from 'echarts';
export default {
    data() {
        return {
            domObj: undefined,
            options: {},
            suffixs: [
                { value: 'xls', label: 'xls' }, { value: 'xlsx', label: 'xlsx' }, { value: 'csv', label: 'csv' },
                { value: 'xml', label: 'xml' }, { value: 'txt', label: 'txt' }, { value: 'html', label: 'html' },
                { value: 'pdf', label: 'pdf' }, { value: 'doc', label: 'doc' }, { value: 'docx', label: 'docx' }
            ]
        }
    },
    props: {
        list: {
            type: Array,
            default: function () {
                return []
            }
        }
    },
    mounted() {
        this.initOptions()
    },
    methods: {
        initOptions() {
            this.loadSource()
        },
        loadSource() {
            this.renderChart()
        },
        renderChart() {
            const myChart = echarts.init(this.$refs.chartRef);
            myChart.setOption(this.options)
            window.addEventListener('resize', () => {
                myChart.resize();
            });
        }
    }
}
